package cn.xopencode.recordservice.dal.mysql.mapper.roomin;

import cn.xopencode.recordservice.dal.mysql.dataobject.roomin.RoomInRecordEmpRelDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoomInRecordEmpRelMapper extends BaseMapper<RoomInRecordEmpRelDO> {

    /**
     * 批量插入。因为 MyBaits Plus 的批量插入是基于 Service 实现，所以只好写 XML
     *
     * @param empRelDOList 数组
     */
    int insertList(@Param("empRelDOList") List<RoomInRecordEmpRelDO> empRelDOList);

    default List<RoomInRecordEmpRelDO> selectListByRecordId(String recordId){
        return selectList((new QueryWrapper<RoomInRecordEmpRelDO>().eq("record_id", recordId)));
    }


    default int deleteByRecordId(String recordId){
        return delete(new QueryWrapper<RoomInRecordEmpRelDO>().eq("record_id", recordId));
    }




}
